package cc.htdf.gwc.datacompare.repository;

import cc.htdf.gwc.datacompare.domain.DataCompare;
import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException;
import org.springframework.dao.DuplicateKeyException;

import java.util.List;
import java.util.Map;

/**
 * Created by JT on 2017/10/12.
 */
public interface DataCompareRepository {

    /**
     * 批量存储比较结果
     * @param datas
     */
    void batchSaveCompareData(List<DataCompare> datas) throws MySQLIntegrityConstraintViolationException, DuplicateKeyException;


    /**
     * * 根据发布时次、预报次数、要素查询数据
     * @param modelRunDateTime：发布时次, "yyyyMMddHH"
     * @param startValidTime: 开始预报时间
     * @param endValidTime：结束预报时间
     * @return
     */
    List<Map<String, Object>> findCompareDatasByModelRunDateTimeAndTimes(String modelRunDateTime, String startValidTime, String endValidTime);

}
